/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
*                                                                        *
* Author: The ALICE Off-line Project.                                    *
* Contributors are mentioned in the code where appropriate.              *
*                                                                        *
* Permission to use, copy, modify and distribute this software and its   *
* documentation strictly for non-commercial purposes is hereby granted   *
* without fee, provided that the above copyright notice appears in all   *
* copies and that both the copyright notice and this permission notice   *
* appear in the supporting documentation. The authors make no claims     *
* about the suitability of this software for any purpose. It is          *
* provided "as is" without express or implied warranty.                  *
**************************************************************************/
//
//Xianguo Lu <lu@physi.uni-heidelberg.de>
//

#ifndef ALIANALYSISTASKDEDXCOSMIC_H
#define ALIANALYSISTASKDEDXCOSMIC_H

#ifndef ALIANALYSISTASKSE_H
#include "AliAnalysisTaskSE.h"
#endif

#include <TH1I.h>
#include <TH2I.h>
#include <TTreeStream.h>
#include "AliESDEvent.h"

class AliAnalysisTaskdEdxCosmic : public AliAnalysisTaskSE
{
 public:
  
  AliAnalysisTaskdEdxCosmic(const TString chunk);
  ~AliAnalysisTaskdEdxCosmic();
  void UserExec(Option_t *);
  void Terminate(Option_t *);

 private:
  Bool_t CutESD(Int_t &mag, Int_t &btrig, Int_t &run, Int_t &spe);
  Bool_t CutMinPhi(const AliExternalTrackParam *params[]);

  TTreeSRedirector *fStream;

  AliESDEvent *fESDEvent;               
  AliESDfriend     *fESDfriend;    

  TString fChunk;
  
  TH1I *fhtrig;
  TH1I *fhntrdv1;
  TH2I *fhnpair;
  TH1I *fhreuse;
  TH1D *fhminphi;
  TH1I *fhnfillevent;
  TH1I *fhnfilltrk;


  TList *fHist;                       	

  ClassDef(AliAnalysisTaskdEdxCosmic, 0);
};
#endif

